package com.cssy.yd.basic.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.yd.basic.dao.BasicModeDeliveryDAO;
import com.cssy.yd.basic.dao.BasicModePaymentDAO;
import com.cssy.yd.basic.entity.BasicAreaDO;
import com.cssy.yd.basic.entity.BasicModeDeliveryDO;
import com.cssy.yd.basic.entity.BasicModePaymentDO;
import com.cssy.yd.basic.service.IBasicModeDeliveryService;
import com.cssy.yd.basic.service.IBasicModePaymentService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.plat.util.IDCodeTypeUtil;

@Service("basicModeDeliveryService")
public class BasicModeDeliveryServiceImpl implements IBasicModeDeliveryService {

	@Resource(name="basicModeDeliveryDAO")
	private BasicModeDeliveryDAO basicModeDeliveryDAO;
	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		SearchResult rs=new SearchResult(scs);
		List<BasicModeDeliveryDO>  list=basicModeDeliveryDAO.find(scs);
		rs.setRecordCount(basicModeDeliveryDAO.count(scs));
		rs.setResults(list);
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		basicModeDeliveryDAO.deleteBasicModeDeliveryDOByPrimaryKey(id);
		return null;
	}

	@Override
	public Integer update(BasicModeDeliveryDO t, User user)
			throws SyBaseException {
		t.setDuuser(user.getName());
		t.setDutime(new Date());
		return basicModeDeliveryDAO.updateBasicModeDeliveryDO(t);
	}

	@Override
	public BasicModeDeliveryDO save(BasicModeDeliveryDO t, User user)
			throws SyBaseException {
		t.setDcruser(user.getName());
		t.setDctime(new Date());
		t.setId(IDCodeTypeUtil.getId());
		basicModeDeliveryDAO.insertBasicModeDeliveryDO(t);
		return t;
	}

	@Override
	public BasicModeDeliveryDO findListById(String id) throws SyBaseException {
		
		return basicModeDeliveryDAO.findBasicModeDeliveryDOByPrimaryKey(id);
	}

	@Override
	public List<BasicModeDeliveryDO> findListByExample(
			BasicModeDeliveryDO bDeliveryDO) throws SyBaseException {

		return basicModeDeliveryDAO.findListByExample(bDeliveryDO);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}

}
